# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from typing import Union
from decimal import Decimal
from fastapi import Query
from pydantic import BaseModel, Field


class RegRewardEditIn(BaseModel):
    """ 注册赠送编辑参数 """
    status: int = Field(default=0, ge=0, le=1, description="是否禁用: [0=否, 1=是]")
    points: int = Field(default=0, ge=0, description="赠送积分")
    train: int = Field(default=0, ge=0, description="赠送训练组")
    robot: int = Field(default=0, ge=0, description="赠送智能体")
    know: int = Field(default=0, ge=0, description="赠送知识库")
    mcp: int = Field(default=0, ge=0, description="赠送MCP")

    @classmethod
    def messages(cls):
        return {
            "points.ge": "赠送积分不能少于0",
            "train.ge": "赠送训练组不能少于0",
            "robot.ge": "赠送智能体不能少于0",
            "know.ge": "赠送知识库不能少于0",
            "mcp.ge": "赠送MCP不能少于0",
            "status.ge": "状态非合法值: [0, 1]",
            "status.le": "状态非合法值: [0, 1]"
        }

    class Config:
        json_schema_extra = {
            "example": {
                "points": 10,
                "train": 10,
                "robot": 10,
                "know": 10,
                "mcp": 10,
                "status": 0
            }
        }


"""--------------- Separator ---------------"""


class RegRewardConfVo(BaseModel):
    """ 注册赠送配置Vo """
    points: int = Field(description="赠送积分")
    train: int = Field(description="赠送训练组")
    robot: int = Field(description="赠送智能体")
    know: int = Field(description="赠送知识库")
    mcp: int = Field(description="赠送MCP")
    status: int = Field(description="是否禁用: [0=否, 1=是]")

    class Config:
        json_schema_extra = {
            "example": {
                "points": 10,
                "train": 10,
                "robot": 10,
                "know": 10,
                "mcp": 10,
                "status": 0
            }
        }
